package com.wlb365.admin.modules.devops.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wlb365.admin.modules.devops.dto.IsvRoleDTO;
import com.wlb365.admin.modules.devops.dto.KeysRoleGroupDTO;
import com.wlb365.admin.modules.devops.entity.IsvRole;
import com.wlb365.admin.modules.devops.mapper.IsvRoleMapper;
import com.wlb365.admin.modules.devops.service.IsvRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * isv角色 服务实现类
 * </p>
 *
 * @author
 * @since 2020-04-09 16:08:39
 */
@Service
public class IsvRoleServiceImpl extends ServiceImpl<IsvRoleMapper, IsvRole> implements IsvRoleService {

    @Override
    public Page<IsvRole> listIsvRolePage(IsvRole isvRole) {
        Page<IsvRole> page = new Page<>(isvRole.getCurrent(), isvRole.getSize());
        List<IsvRole> isvRoles = baseMapper.selectIsvRoleList(isvRole, page);
        return page.setRecords(isvRoles);
    }

    @Override
    public KeysRoleGroupDTO selectIsvRoleGroupByIsvId(Long isvId) {
        return baseMapper.selectIsvRoleGroupByIsvId(isvId);
    }

    @Override
    public void deleteIsvRoleGroupByIsvId(Long isvId) {
        baseMapper.deleteIsvRoleGroupByIsvId(isvId);
    }

    @Override
    public void insertIsvRoleBatch(List<IsvRoleDTO> list) {
        baseMapper.insertIsvRoleBatch(list);
    }
}
